﻿using HiSport.Core.Entity.Order;
using HiSport.Core;
using HiSport.Core.Util;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HiSport.Application.Service.Order.OrderSite.Dtos
{


    /// <summary>
    /// 订单dto
    /// </summary>
    public class OrderSiteDto : Core.Entity.Order.OrderSite
    {
        public List<OrderSiteInfoDto> OrderInfos { get; set; }

        /// <summary>
        /// 总金额
        /// </summary>
        public decimal TotalAmount { get; set; }

        /// <summary>
        /// 优惠金额
        /// </summary>
        public decimal DiscountAmount { get; set; }

        /// <summary>
        /// 实付金额
        /// </summary>
        public decimal ActualPayAmount { get; set; }

        /// <summary>
        /// 未付金额
        /// </summary>
        public decimal UnpaidAmount { get; set; }


        /// <summary>
        /// 场地类型名称
        /// </summary>
        public string SiteTypeName { get; set; }

        /// <summary>
        /// 场地名称
        /// </summary>
        public string SiteName { get; set; }
    }

    /// <summary>
    /// 订单详情Dto
    /// </summary>
    public class OrderSiteInfoDto : OrderSiteInfo
    {

    }



    /// <summary>
    /// 获取订单分页 Dto
    /// </summary>
    public class OrderSitePageInputDto : BasePageInput
    {
        /// <summary>
        /// 订单预定开始时间
        /// </summary>
        public DateTime? ScheduledTimeStart { get; set; }

        /// <summary>
        /// 订单预定结束时间
        /// </summary>
        public DateTime? ScheduledTimeEnd { get; set; }


        /// <summary>
        /// 订单创建开始时间
        /// </summary>
        public DateTime? OrderTimeStart { get; set; }

        /// <summary>
        /// 订单创建结束时间
        /// </summary>
        public DateTime? OrderTimeEnd { get; set; }

        /// <summary>
        /// 固定预定开始时间  
        /// </summary>
        public DateTime? FixedStartTime { get; set; }

        /// <summary>
        /// 固定预定结束时间  
        /// </summary>
        public DateTime? FixedEndTime { get; set; }


        /// <summary>
        /// 场地类型
        /// </summary>
        public long? SiteTypeId { get; set; }

        /// <summary>
        /// 场地类型
        /// </summary>
        public long? SiteId { get; set; }

        /// <summary>
        /// 会员名称/电话号码
        /// </summary>
        public string MemberInfo { get; set; }

        /// <summary>
        /// 订单来源
        /// </summary>
        public OrderSourceEnum? OrderSource { get; set; }


        /// <summary>
        /// 订单状态
        /// </summary>
        public OrderStateEnum? OrderState { get; set; }

    }


    /// <summary>
    /// 创建主订单dto
    /// </summary>
    public class OrderSiteCreateDto
    {

        /// <summary>
        /// 预定时间
        /// </summary>
        [SugarColumn(ColumnDescription = "预定时间", IsNullable = true)]
        public DateTime ScheduledTime { get; set; }

        /// <summary>
        /// 场地类型
        /// </summary>
        public long SiteTypeId { get; set; }

        /// <summary>
        /// 场地
        /// </summary>
        public long SiteId { get; set; }



        /// <summary>
        /// 会员ID
        /// </summary>
        public long MemberId { get; set; }

        /// <summary>
        /// 会员名称
        /// </summary>
        public string MemberName { get; set; }

        /// <summary>
        /// 会员电话
        /// </summary>
        public string Phone { get; set; }


        /// <summary>
        /// 订单来源
        /// </summary>
        public OrderSourceEnum? OrderSource { get; set; }



        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }

        public List<OrderSiteInfoCreateDto> OrderSiteInfos { get; set; }
    }

    /// <summary>
    /// 创建子订单dto
    /// </summary>
    public class OrderSiteInfoCreateDto
    {
        /// <summary>
        /// 预定时间
        /// </summary>
        public DateTime ScheduledTime { get; set; }

        public long OrderId { get; set; }

        /// <summary>
        /// 场地类型
        /// </summary>
        public long SiteTypeId { get; set; }

        /// <summary>
        /// 场地
        /// </summary>
        public long SiteId { get; set; }


        /// <summary>
        /// 开始
        /// </summary>
        public string StartTime { get; set; }

        /// <summary>
        /// 结束
        /// </summary>
        public string EndTime { get; set; }



       

        /// <summary>
        /// 原价
        /// </summary>
        public decimal OriginalPrice { get; set; }


        /// <summary>
        /// 实付金额
        /// </summary>
        public decimal ActualPayAmount { get; set; }



        /// <summary>
        /// 备注
        /// </summary>
        [MaxLength(300)]
        public string Remark { get; set; }
    }

}
